/***************************************************************************
 *   Copyright (C) 2009 by Marian Skvarek   *
 *   skvarek.marian@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef EASYSCORE_GLOBALSCRESOURCES_H
#define EASYSCORE_GLOBALSCRESOURCES_H

#include "CGlobals.h"
#include "CClef.h"
#include "CNote.h"

#include <QMap>
#include <QPixmap>
#include <QIcon>

using namespace easyscore::core;

namespace easyscore
{
	namespace globals
	{

		/**
			Class managing resources such as pictures and GUI text
			@author Marian Skvarek <skvarek.marian@gmail.com>
		*/
		class CResources
		{
//Members
			private:
				static CResources *mInstance;
				
				QMap<NOTE_VALUE,QPixmap *> mNotePixmaps;
                                QMap<NOTE_VALUE,QPixmap *> mActiveNotePixmaps;
				QMap<NOTE_VALUE,QPixmap *> mPausePixmaps;
				QMap<EClef,QPixmap *> mClefPixmaps;
                                QMap<EAccidental,QPixmap *> mAccidentalPixmaps;
                                QPixmap mRightFlagPixmap;
                                QPixmap mLeftFlagPixmap;

                                QPixmap mGhostNotePixmap;
                                QPixmap mActiveGhostNotePixmap;

                                QIcon mSharpIcon;

//Accessors
			public:
				static CResources *getInstance()
				{
					if ( mInstance == 0 )
						mInstance = new CResources();
					return mInstance;
				}

//Constructors, Destructors
			private:
				CResources();
				void initialize();
				
			public:
				~CResources();
				
//Public methods
			public:
				QPixmap &getNotePixmap ( NOTE_VALUE value );
                                QPixmap &getActiveNotePixmap ( NOTE_VALUE value );
				QPixmap &getPausePixmap ( NOTE_VALUE value );

				QPixmap &getClefPixmap ( EClef clef );
                                QPixmap &getAccidentalPixmap(EAccidental accidental);
                                QPixmap &getRightFlagPixmap() { return mRightFlagPixmap; }
                                QPixmap &getLeftFlagPixmap() { return mLeftFlagPixmap; }
                                QPixmap &getGhostNotePixmap() { return mGhostNotePixmap; }
                                QPixmap &getActiveGhostNotePixmap() { return mActiveGhostNotePixmap; }
				
		};

	}//namespace globals
}//namespace easyscore

#endif
